﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TribesPSO;

namespace TribesPSOTest
{
    internal class BaseSearchSpace : SearchSpace<IndependentGaussianParticle>
    {
        public BaseSearchSpace(IObjectiveFunction function) : base(function) { }

        protected override void Move()
        {
            foreach (Particle p in this.Tribes.SelectMany(o => o.TribeMembers))
            {
                p.Move();
            }
        }

        protected override IndependentGaussianParticle GenerateParticleAtPosition(EuclidianVector position)
        {
            return new IndependentGaussianParticle(this.GoodnessFunction, position);
        }
    }
}
